package Models

type RecruitPositionCategory struct { // 默认操作的是这张表的复数
	Id         int64  `json:"id" gorm:"primary_key"`
	Name       string `json:"id" gorm:"size:30"`
	Pid        int64  `json:"id" gorm:"size:10"`
	BusinessId int    `json:"id" gorm:"size:10"`
	Code       int    `json:"id" gorm:"type:int(10)"`
	Status     int    `json:"status" gorm:"size:10"`
	IsDelete   int    `json:"is_deleted" gorm:"column:is_deleted; size:10"`
	CreatedAt  string `json:"created_at" gorm:"size:20"`
	UpdatedAt  string `json:"updated_at" gorm:"size:20"`
}

func (RecruitPositionCategory) TableName() string {
	return "recruit_position_category"
}

func GetCate() []RecruitPositionCategory {
	cate := []RecruitPositionCategory{}
	field := "id,name,pid"
	DB.Where("status = ?", 4).Select(field).Find(&cate)

	return cate
}
